from enum import Enum


class ConstantConfig:
    """公共配置"""
    # 管理缓存键
    backstage_manage_key: str = 'backstage:manage'
    # 角色缓存键
    backstage_roles_key: str = 'backstage:roles'
    # app角色缓存键
    backstage_tabbar_key: str = 'backstage:roles'
    # 令牌缓存键
    backstage_token_key: str = 'backstage:token:'
    # 令牌的集合
    backstage_token_set: str = 'backstage:token:set:'

    # 用户转socket客户端
    socket_user_client: str = 'socket:user:client:'
    # socket客户端转用户
    socket_client_user: str = 'socket:client:user:'

    # 登录有效时间 (单位秒)
    token_valid_time = 7200
    # 登录续签时间 (不足以下秒数续签)
    token_renew_time = 1800

    # 消息前缀
    info_prefix: str = 'info_'
    work_edit_prefix: str = 'work_edit_'
    brand_add_prefix: str = 'brand_add_'
    device_edit_prefix: str = 'device_edit_'
    device_status_prefix: str = 'device_status_'
    user_add_prefix: str = 'user_add_'
    basic_data_prefix: str = 'basic_data_'


    # 免登录验证
    not_login_uri = [
        'system/login',  # 登录接口
        'common/index/config',  # 配置接口
        'setting/app_config',  # 配置接口
        'setting/protocol/detail',
        'config',  # 配置接口
        # "index",
        "policy",
        "hotSearch",
        "decorate",
        "sms/send",
        # "upload/image",

        "login/check",
        "login/codeUrl",
        "login/oaLogin",
        "login/register",
        "login/forgotPassword",
        "login/getScanCode",
        "login/scanLogin"

        "pc/getConfig",
        "pc/index",

        'app_packages/app_packages_manager/add',
    ]

    # 免权限验证
    not_auth_uri = [
        'system:logout',  # 退出登录
        'system:menu:menus',  # 系统菜单
        'system:menu:route',  # 菜单路由
        'system:admin:upInfo',  # 管理员更新
        'system:admin:self',  # 管理员信息
        'system:admin:del',  # 注销用户

        'system:role:all',  # 所有角色
        'system:post:all',  # 所有岗位
        'system:dept:all',  # 所有部门
        'setting:dict:type:all',  # 所有字典类型
        'setting:dict:data:all',  # 所有字典数据
        'system:administrative_division:all',  # 省市区所有数据

        'common:upload:image',  # 上传图片
        'common:upload:file',
        'common:index:console',
        'user:bindMobile',  # 修改手机号
        'user:bindMobile',  # 修改手机号
        'user:mnpMobile',  # 微信电话
        'user:changePwd',  # 修改密码
        'user:all',
        'user:sum_user_data',
        'user:sum_user_addr',
        'user:sum_child_user',
        'user:sum_user_year_month',

        'device:device_ink_jet_printing:sum_device',
        'device:device_ink_jet_printing:sum_device_by_status',
        'device:device_ink_jet_printing:sum_device_type',
        'device:device_ink_jet_printing:sum_device_brand_name',
        'device:device_ink_jet_printing:sum_device_addr',
        'device:device_ink_jet_printing:get_gateway_code',
        'device:device_ink_jet_printing_record:sum_type',
        'device:device_ink_jet_printing:sum_device_city',
        'device:device_brand:all',
        'gateway_version:device_gateway_version:all',
        'device:device_product_model:all',

        'work_order:work_order:sum_work_order',
        'app_packages:app_packages_manager:list',
        'app_packages:app_packages_manager:add',

        'ai:ai_chat:list',
        'ai:ai_chat:del',
        'ai:ai_chat:chat',

        'system:system_industry:list',
        'system:system_industry:all',

        'information:site_information:edit',

        'setting:website:detail',
    ]
